<?php session_start(); $_SESSION['page'] = 'library';?>
<?php
    require('db_connection.php');
    $query = "SELECT libraryName, libraryNo FROM tbllibrary";
    $result = mysql_query($query);
    $ctr = mysql_num_rows($result);
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>
   <head>
      <title>Library List</title>
      <meta http-equiv="generator" content="PHP Designer 2005" />
      <style type="text/css">
        @import url(style.css);
      </style>
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000" class=''>

   <?php echo "<form method='post' action='delete.php?page=library&libraryCtr=$ctr'>"; ?>
    <table width='80%' align='center' class='content'>
        <tr><td colspan='2'><img src='images/banner1.jpg'></td></tr>
            <tr><td align='right' colspan='2' class='logborder'><?php require ('loginout.php');?></td></tr>
            <tr class='menuborder'><td width='90%'><img src='images/liblist.png'></td><td><?php  require('buttons.php'); ?></td></tr>
            <tr><td colspan='2' class='bodyborder'>
            <table align='center'>
                <tr><td height='30'></td></tr>
                <tr><td></td>
                    <td>
                    <?php
                        $ctr1=1;
                          /*
                            require('db_connection.php');
                          $query = "SELECT libraryName, libraryNo FROM tbllibrary";
                          $result = mysql_query($query);
*/
                          while ($row = mysql_fetch_array($result))
                            {
                                        
                                        $libraryNo = $row['libraryNo'];
                                        $libraryName = $row['libraryName'];
                                        //echo "<form action='delete.php?page=library' method='post'>";
                                        echo "<tr><td><input type='checkbox' name='libraryName[$ctr1]' value='$libraryNo'>$libraryName</td></tr>";
                                        //echo"<a href=editlibrary.php?libraryNo=$libraryNo>$libraryName</a><br />";
                                        //echo"<option value=$libraryNo>"." $location "." ";
                                $ctr1++;
                            }

                    ?>
                        <tr><td height='15'></td></tr>
                        <tr><td align='right'><input type='submit' value='Delete' class='tool'></td></tr>
                    </td>
                </tr>
                <tr><td height='30'></td></tr>
            </table>
            </td>
        </tr>
        <tr><td align='center' colspan='2'><?php require ('copyright.php')?></td></tr>
    </table>
    </form>

   </body>
</html>
